<!DOCTYPE html>
<!-- saved from url=(0090)http://provide.smashingmagazine.com/introduction-to-js-unit-testing-code/4-qunit-test.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	<title>✔ Refactored date examples</title>

	<link rel="stylesheet" href="http://provide.smashingmagazine.com/introduction-to-js-unit-testing-code/qunit.css">
	<script src="./ejemploQunit_files/qunit.js"></script>
	<script src="./ejemploQunit_files/prettydate.js"></script>

	<script>
	test("prettydate basics", function() {
		var now = "2008/01/28 22:25:00";
		equal(prettyDate(now, "2008/01/28 22:24:30"), "just now");
		equal(prettyDate(now, "2008/01/28 22:23:30"), "1 minute ago");
		equal(prettyDate(now, "2008/01/28 21:23:30"), "1 hour ago");
		equal(prettyDate(now, "2008/01/27 22:23:30"), "Yesterday");
		equal(prettyDate(now, "2008/01/26 22:23:30"), "2 days ago");
		equal(prettyDate(now, "2007/01/26 22:23:30"), undefined);
		equal(saludar("emiliano"),"hola emiliano");
		//equal(saludar("emiliano"),"hola");
	});

	test("deberia fallar", function(){
		equal(saludar("emiliano"),"hola");
	});
	</script>
</head>
<body>
	<div id="qunit"><h1 id="qunit-header"><a href="./ejemploQunit_files/ejemploQunit.htm">Refactored date examples</a> <label><input name="noglobals" type="checkbox">noglobals</label><label><input name="notrycatch" type="checkbox">notrycatch</label></h1><h2 id="qunit-banner" class="qunit-pass"></h2><div id="qunit-testrunner-toolbar"><input type="checkbox" id="qunit-filter-pass"><label for="qunit-filter-pass">Hide passed tests</label></div><h2 id="qunit-userAgent">Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11</h2><p id="qunit-testresult" class="result">Tests completed in 20 milliseconds.<br><span class="passed">6</span> tests of <span class="total">6</span> passed, <span class="failed">0</span> failed.</p><ol id="qunit-tests"><li class="pass" id="qunit-test-output0"><strong><span class="test-name">prettydate basics</span> <b class="counts">(<b class="failed">0</b>, <b class="passed">6</b>, 6)</b></strong><a href="http://provide.smashingmagazine.com/introduction-to-js-unit-testing-code/4-qunit-test.html?filter=prettydate%20basics">Rerun</a><ol style="display: none;"><li class="pass"><span class="test-message">okay</span></li><li class="pass"><span class="test-message">okay</span></li><li class="pass"><span class="test-message">okay</span></li><li class="pass"><span class="test-message">okay</span></li><li class="pass"><span class="test-message">okay</span></li><li class="pass"><span class="test-message">okay</span></li></ol></li></ol></div>

</body></html>